using UnityEngine;
using System.Collections;

public abstract class Motor : MonoBehaviour 
{
	public float HorizontalSpeed = .5f;
    public float VerticalSpeed = .5f;
    private float directionTimer = 0;
    public float directionSwitchTime = 0;
    private Transform Wave = null;
    private Manager difficultyManager = null;
    private EnemyDifficultyManager difficulty;

    public void Start()
    {
        Wave = GameObject.FindGameObjectWithTag("WaveManager").transform;
    }

	public void Move()
	{
		Vector3 direction = Vector3.zero;
		SetDirection(ref direction);
		rigidbody.MovePosition(transform.position + direction);
	}
	
    public void Update()
    {
        if (directionTimer > directionSwitchTime && directionSwitchTime != 0)
        {
            HorizontalSpeed = -HorizontalSpeed;
            directionTimer = 0;
        }
        directionTimer += Time.deltaTime;
    }
	protected abstract void SetDirection(ref Vector3 dir);
}
